本文整理匯總了C#中NdefLibrary.Ndef.NdefRecord.CheckSpecializedType方法的典型用法代碼示例。如果您正苦於以下問題:C# NdefRecord.CheckSpecializedType方法的具體用法?C# NdefRecord.CheckSpecializedType怎麽用?C# NdefRecord.CheckSpecializedType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類NdefLibrary.Ndef.NdefRecord
的用法示例。
在下文中一共展示了NdefRecord.CheckSpecializedType方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: HandleNDEFRecord
private string HandleNDEFRecord(NdefRecord record)
{
string tag = string.Empty;
var specializedType = record.CheckSpecializedType(false);
if (specializedType == typeof(NdefTextRecord))
{
var oRecord = new NdefTextRecord(record);
try
{
tag = oRecord.Text;
this.NotifyUser(tag, NotifyType.PublishMessage);
}
catch { }
}
else if (specializedType == typeof(NdefSpRecord))
{
var oRecord = new NdefSpRecord(record);
//this.NotifyUser(NotifyType.PeerMessage, "Not Supportint Type, Value (Uri:" + oRecord.Uri + ")");
}
else if (specializedType == typeof(NdefUriRecord))
{
var oRecord = new NdefUriRecord(record);
//this.NotifyUser(NotifyType.PeerMessage, "Not Supportint Type, Value (Uri:" + oRecord.Uri + ")");
}
else if (specializedType == typeof(NdefTelRecord))
{
var oRecord = new NdefTelRecord(record);
//this.NotifyUser(NotifyType.PeerMessage, "Not Supportint Type, Value (Tel:" + oRecord.TelNumber + ")");
}
else if (specializedType == typeof(NdefMailtoRecord))
{
var oRecord = new NdefMailtoRecord(record);
//this.NotifyUser(NotifyType.PeerMessage, "Not Supportint Type, Value (Subject:" + oRecord.Subject + ")");
}
else if (specializedType == typeof(NdefAndroidAppRecord))
{
var oRecord = new NdefAndroidAppRecord(record);
//this.NotifyUser(NotifyType.PeerMessage, "Not Supportint Type, Value (Package:" + oRecord.PackageName + ")");
}
else if (specializedType == typeof(NdefLaunchAppRecord))
{
var oRecord = new NdefLaunchAppRecord(record);
//this.NotifyUser(NotifyType.PeerMessage, "Not Supportint Type, Value (Platform:" + oRecord.PlatformIds + ")");
}
else if (specializedType == typeof(NdefSmsRecord))
{
var oRecord = new NdefSmsRecord(record);
//this.NotifyUser(NotifyType.PeerMessage, "Not Supportint Type, Value (Sms:" + oRecord.SmsBody + ")");
}
else if (specializedType == typeof(NdefSmartUriRecord))
{
var oRecord = new NdefSmartUriRecord(record);
//this.NotifyUser(NotifyType.PeerMessage, "Not Supportint Type, Value (Uri:" + oRecord.Uri + ")");
}
else
{
//this.NotifyUser(NotifyType.PeerMessage, "Not Supporting Type");
}
return tag;
}