本文整理汇总了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;
}