/// </summary>
public class NfcTagInformation
{
- internal NfcTagInformation()
- {
+ private string _key;
+ private byte[] _informationValue;
+ internal NfcTagInformation(string key, byte[] informationValue)
+ {
+ _key = key;
+ _informationValue = informationValue;
}
+
/// <summary>
/// Key value.
/// </summary>
- public string Key;
+ public string Key
+ {
+ get
+ {
+ return _key;
+ }
+ }
/// <summary>
/// Information value.
/// </summary>
- public byte[] InformationValue;
+ public byte[] InformationValue
+ {
+ get
+ {
+ return _informationValue;
+ }
+ }
}
/// <summary>
/// </summary>
public class NfcRegisteredAidInformation
{
- internal NfcRegisteredAidInformation()
- {
+ private NfcSecureElementType _seType;
+ private string _aid;
+ private bool _readOnly;
+ internal NfcRegisteredAidInformation(NfcSecureElementType seType, string aid, bool readOnly)
+ {
+ _seType = seType;
+ _aid = aid;
+ _readOnly = readOnly;
}
+
/// <summary>
/// Secure Element Type value.
/// </summary>
- public NfcSecureElementType SeType;
+ public NfcSecureElementType SeType
+ {
+ get
+ {
+ return _seType;
+ }
+ }
+
/// <summary>
- /// Aid value.
+ ///
+ /// The targeted Aid (Application Identifier) value.
/// </summary>
- public string Aid;
+ public string Aid
+ {
+ get
+ {
+ return _aid;
+ }
+ }
+
/// <summary>
- /// Read-only value.
+ /// Read-only value. If this value is false, there are restrictions to the operation on this Aid.
/// </summary>
- public bool ReadOnly;
+ public bool ReadOnly
+ {
+ get
+ {
+ return _readOnly;
+ }
+ }
}
}
if (!isNfcSupported)
{
- return false;
+ throw new NotSupportedException();
}
try
{
return NfcManagerImpl.Instance.IsSupported;
}
- catch (TypeInitializationException)
+ catch (TypeInitializationException e)
{
- return false;
+ throw e.InnerException;
}
}
}
if (!isNfcSupported)
{
- return false;
+ throw new NotSupportedException();
}
try
{
return NfcManagerImpl.Instance.IsActivated;
}
- catch (TypeInitializationException)
+ catch (TypeInitializationException e)
{
- return false;
+ throw e.InnerException;
}
}
}
if (!isNfcSupported || !isTagSupported)
{
- return NfcTagFilterType.AllDisable;
+ throw new NotSupportedException();
}
try
{
return NfcManagerImpl.Instance.TagFilterType;
}
- catch (TypeInitializationException)
+ catch (TypeInitializationException e)
{
- return NfcTagFilterType.AllDisable;
+ throw e.InnerException;
}
}
set
if (!isNfcSupported || !isTagSupported)
{
- return;
+ throw new NotSupportedException();
}
try
{
NfcManagerImpl.Instance.TagFilterType = value;
}
- catch (TypeInitializationException)
+ catch (TypeInitializationException e)
{
- return;
+ throw e.InnerException;
}
}
}
if (!isNfcSupported || !isCeSupported)
{
- return NfcSecureElementType.Disable;
+ throw new NotSupportedException();
}
try
{
return NfcManagerImpl.Instance.SecureElementType;
}
- catch (TypeInitializationException)
+ catch (TypeInitializationException e)
{
- return NfcSecureElementType.Disable;
+ throw e.InnerException;
}
}
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);
+
+ if (!isNfcSupported || !isCeSupported)
+ {
+ throw new NotSupportedException();
+ }
+
try
{
NfcManagerImpl.Instance.SecureElementType = value;
}
- catch (TypeInitializationException)
+ catch (TypeInitializationException e)
{
+ throw e.InnerException;
}
}
}
if (!isNfcSupported)
{
- return false;
+ throw new NotSupportedException();
}
try
{
return NfcManagerImpl.Instance.SystemHandlerEnabled;
}
- catch (TypeInitializationException)
+ catch (TypeInitializationException e)
{
- return false;
+ throw e.InnerException;
}
}
set
if (!isNfcSupported)
{
- return;
+ throw new NotSupportedException();
}
try
{
NfcManagerImpl.Instance.SystemHandlerEnabled = value;
}
- catch (TypeInitializationException)
+ catch (TypeInitializationException e)
{
- return;
+ throw e.InnerException;
}
}
}
if (!isNfcSupported)
{
- return null;
+ throw new NotSupportedException();
}
try
{
return NfcManagerImpl.Instance.CachedNdefMessage;
}
- catch (TypeInitializationException)
+ catch (TypeInitializationException e)
{
- return null;
+ throw e.InnerException;
}
}
}