Release 4.0.0-preview1-00201
[platform/core/csapi/tizenfx.git] / src / Tizen.Network.Nfc / Tizen.Network.Nfc / NfcManager.cs
index c8ad62e..41fe3cf 100755 (executable)
@@ -22,21 +22,23 @@ using Tizen.System;
 namespace Tizen.Network.Nfc
 {
     /// <summary>
-    /// A class for NFC management. It allows applications to use NFC service.
+    /// A class for the NFC management. It allows applications to use the NFC service.
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
     /// <privilege>http://tizen.org/privilege/nfc</privilege>
     static public class NfcManager
     {
         /// <summary>
-        /// Whether NFC is supported.
+        /// Checks whether the NFC is supported.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         static public bool IsSupported
         {
             get
             {
-                bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
+                bool isNfcSupported = false;
+
+                Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
 
                 if (!isNfcSupported)
                 {
@@ -55,14 +57,16 @@ namespace Tizen.Network.Nfc
         }
 
         /// <summary>
-        /// NFC Activation state.
+        /// The NFC Activation state.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         static public bool IsActivated
         {
             get
             {
-                bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
+                bool isNfcSupported = false;
+
+                Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
 
                 if (!isNfcSupported)
                 {
@@ -88,8 +92,11 @@ namespace Tizen.Network.Nfc
         {
             get
             {
-                bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
-                bool isTagSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc.tag", out isTagSupported);
+                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)
                 {
@@ -107,8 +114,11 @@ namespace Tizen.Network.Nfc
             }
             set
             {
-                bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
-                bool isTagSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc.tag", out isTagSupported);
+                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)
                 {
@@ -135,8 +145,11 @@ namespace Tizen.Network.Nfc
         {
             get
             {
-                bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
-                bool isCeSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc.cardemulation", out isCeSupported);
+                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)
                 {
@@ -154,8 +167,11 @@ namespace Tizen.Network.Nfc
             }
             set
             {
-                bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
-                bool isCeSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc.cardemulation", out isCeSupported);
+                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)
                 {
@@ -174,7 +190,7 @@ namespace Tizen.Network.Nfc
         }
 
         /// <summary>
-        /// Enable or disable the system handling for tag and target discovered event.
+        /// Enables or disables the system handling for the tag and target discovered event.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         /// <privilege>http://tizen.org/privilege/nfc</privilege>
@@ -182,7 +198,9 @@ namespace Tizen.Network.Nfc
         {
             get
             {
-                bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
+                bool isNfcSupported = false;
+
+                Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
 
                 if (!isNfcSupported)
                 {
@@ -200,7 +218,9 @@ namespace Tizen.Network.Nfc
             }
             set
             {
-                bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
+                bool isNfcSupported = false;
+
+                Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
 
                 if (!isNfcSupported)
                 {
@@ -219,14 +239,16 @@ namespace Tizen.Network.Nfc
         }
 
         /// <summary>
-        /// The cached Ndef Message.
+        /// The cached NDEF message.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         static public NfcNdefMessage CachedNdefMessage
         {
             get
             {
-                bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
+                bool isNfcSupported = false;
+
+                Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
 
                 if (!isNfcSupported)
                 {
@@ -245,13 +267,16 @@ namespace Tizen.Network.Nfc
         }
 
         /// <summary>
-        /// Gets Tag adapter object.
+        /// Gets the Tag adapter object.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         static public NfcTagAdapter GetTagAdapter()
         {
-            bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
-            bool isTagSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc.tag", out isTagSupported);
+            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)
             {
@@ -269,13 +294,16 @@ namespace Tizen.Network.Nfc
         }
 
         /// <summary>
-        /// Gets P2p adapter object.
+        /// Gets the P2P adapter object.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         static public NfcP2pAdapter GetP2pAdapter()
         {
-            bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
-            bool isP2pSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc.p2p", out isP2pSupported);
+            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)
             {
@@ -293,13 +321,16 @@ namespace Tizen.Network.Nfc
         }
 
         /// <summary>
-        /// Gets Card Emulation adepter object.
+        /// Gets the Card Emulation adapter object.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         static public NfcCardEmulationAdapter GetCardEmulationAdapter()
         {
-            bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
-            bool isCeSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc.cardemulation", out isCeSupported);
+            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)
             {
@@ -317,14 +348,16 @@ namespace Tizen.Network.Nfc
         }
 
         /// <summary>
-        /// Activates Nfc asynchronously.
+        /// Activates the NFC asynchronously.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         /// <returns>A task indicates whether the Activate method is done or not.</returns>
         /// <privilege>http://tizen.org/privilege/nfc.admin</privilege>
         static public Task SetActivationAsync(bool activation)
         {
-            bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
+            bool isNfcSupported = false;
+
+            Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
 
             if (!isNfcSupported)
             {
@@ -349,7 +382,9 @@ namespace Tizen.Network.Nfc
         {
             add
             {
-                bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
+                bool isNfcSupported = false;
+
+                Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
 
                 if (!isNfcSupported)
                 {
@@ -367,7 +402,9 @@ namespace Tizen.Network.Nfc
             }
             remove
             {
-                bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
+                bool isNfcSupported = false;
+
+                Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
 
                 if (!isNfcSupported)
                 {
@@ -386,14 +423,16 @@ namespace Tizen.Network.Nfc
         }
 
         /// <summary>
-        /// The Ndef discovered event.
+        /// The NDEF discovered event.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         static public event EventHandler<NdefMessageDiscoveredEventArgs> NdefMessageDiscovered
         {
             add
             {
-                bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
+                bool isNfcSupported = false;
+
+                Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
 
                 if (!isNfcSupported)
                 {
@@ -411,7 +450,9 @@ namespace Tizen.Network.Nfc
             }
             remove
             {
-                bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
+                bool isNfcSupported = false;
+
+                Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported);
 
                 if (!isNfcSupported)
                 {