From: jh8801.jung Date: Thu, 24 Aug 2017 06:11:35 +0000 (+0900) Subject: Change logic for throw NOT SUPPORTED exception properly X-Git-Tag: preview1-00151~48 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4129a5120320f78c3ce8f5dcef9eb159347a8833;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Change logic for throw NOT SUPPORTED exception properly Signed-off-by: jh8801.jung Change-Id: Ie4abae5ab7b9c055fae7f1676f3e5a6723e09228 --- diff --git a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcManager.cs b/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcManager.cs index c8ad62e3f..98fa29a0e 100755 --- a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcManager.cs +++ b/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcManager.cs @@ -36,7 +36,9 @@ namespace Tizen.Network.Nfc { get { - bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + bool isNfcSupported = false; + + SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); if (!isNfcSupported) { @@ -62,7 +64,9 @@ namespace Tizen.Network.Nfc { get { - bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + bool isNfcSupported = false; + + SystemInfo.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; + + SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + SystemInfo.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; + + SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + SystemInfo.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; + + SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + SystemInfo.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; + + SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc.cardemulation", out isCeSupported); if (!isNfcSupported || !isCeSupported) { @@ -182,7 +198,9 @@ namespace Tizen.Network.Nfc { get { - bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + bool isNfcSupported = false; + + SystemInfo.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; + + SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); if (!isNfcSupported) { @@ -226,7 +246,9 @@ namespace Tizen.Network.Nfc { get { - bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + bool isNfcSupported = false; + + SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); if (!isNfcSupported) { @@ -250,8 +272,11 @@ namespace Tizen.Network.Nfc /// 3 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; + + SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc.tag", out isTagSupported); if (!isNfcSupported || !isTagSupported) { @@ -274,8 +299,11 @@ namespace Tizen.Network.Nfc /// 3 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; + + SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc.p2p", out isP2pSupported); if (!isNfcSupported || !isP2pSupported) { @@ -298,8 +326,11 @@ namespace Tizen.Network.Nfc /// 3 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; + + SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc.cardemulation", out isCeSupported); if (!isNfcSupported || !isCeSupported) { @@ -324,7 +355,9 @@ namespace Tizen.Network.Nfc /// http://tizen.org/privilege/nfc.admin static public Task SetActivationAsync(bool activation) { - bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + bool isNfcSupported = false; + + SystemInfo.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; + + SystemInfo.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; + + SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); if (!isNfcSupported) { @@ -393,7 +430,9 @@ namespace Tizen.Network.Nfc { add { - bool isNfcSupported = SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); + bool isNfcSupported = false; + + SystemInfo.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; + + SystemInfo.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); if (!isNfcSupported) {