Ejemplo n.º 1
0
 /// <summary>
 /// Add another Alternative Carrier record as a child and create the storage list if
 /// necessary. Also automatically updates the payload.
 /// </summary>
 /// <param name="newRecord">Additional Alternative Carrier record to add to the list
 /// for use as children of the Handover Select record.</param>
 public void AddHandoverAlternativeCarrierRecord(NdefHandoverAlternativeCarrierRecord newRecord)
 {
     if (_handoverAlternativeCarrierRecords == null)
     {
         _handoverAlternativeCarrierRecords = new List <NdefHandoverAlternativeCarrierRecord>();
     }
     _handoverAlternativeCarrierRecords.Add(newRecord);
     AssemblePayload();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Create a Handover Select record based on the specified version number and
 /// supplying an alternative carrier record.
 /// </summary>
 /// <param name="version">Version to use for the handover select record.</param>
 /// <param name="alternativeCarrier">A single alternative carrier record. If you want
 /// to add multiple alternative carrier records, use the AddHandoverAlternativeCarrierRecord()
 /// method.</param>
 public NdefHandoverSelectRecord(NdefHandoverVersion version, NdefHandoverAlternativeCarrierRecord alternativeCarrier)
     : base(TypeNameFormatType.NfcRtd, BtHsType)
 {
     _handoverVersion = version;
     AddHandoverAlternativeCarrierRecord(alternativeCarrier);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Create a Handover Select record based on the specified version number and 
 /// supplying an alternative carrier record.
 /// </summary>
 /// <param name="version">Version to use for the handover select record.</param>
 /// <param name="alternativeCarrier">A single alternative carrier record. If you want
 /// to add multiple alternative carrier records, use the AddHandoverAlternativeCarrierRecord()
 /// method.</param>
 public NdefHandoverSelectRecord(NdefHandoverVersion version, NdefHandoverAlternativeCarrierRecord alternativeCarrier)
     : base(TypeNameFormatType.NfcRtd, BtHsType)
 {
     _handoverVersion = version;
     AddHandoverAlternativeCarrierRecord(alternativeCarrier);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Checks the type name format and type of this record and returns
 /// the appropriate specialized class, if one is available and known
 /// for this record type.
 /// </summary>
 /// <param name="checkForSubtypes">If set to true, also checks for
 /// subtypes of the URL / SmartPoster record where the library offers
 /// a convenient handling class - e.g. for SMS or Mailto records,
 /// which are actually URL schemes.</param>
 /// <returns>Type name of the specialized class that can understand
 /// and manipulate the payload through convenience methods.</returns>
 public Type CheckSpecializedType(bool checkForSubtypes)
 {
     // Note: can't check for specialized types like the geo record
     // or the SMS record yet, as these are just convenience classes
     // for creating URI / Smart Poster records.
     if (checkForSubtypes)
     {
         // Need to check specialized URI / Sp records before checking for base types.
         if (NdefSmsRecord.IsRecordType(this))
         {
             return(typeof(NdefSmsRecord));
         }
         if (NdefMailtoRecord.IsRecordType(this))
         {
             return(typeof(NdefMailtoRecord));
         }
         if (NdefTelRecord.IsRecordType(this))
         {
             return(typeof(NdefTelRecord));
         }
         if (NdefWindowsSettingsRecord.IsRecordType(this))
         {
             return(typeof(NdefWindowsSettingsRecord));
         }
     }
     // Unique / base record types
     if (NdefUriRecord.IsRecordType(this))
     {
         return(typeof(NdefUriRecord));
     }
     if (NdefSpRecord.IsRecordType(this))
     {
         return(typeof(NdefSpRecord));
     }
     if (NdefTextRecord.IsRecordType(this))
     {
         return(typeof(NdefTextRecord));
     }
     if (NdefSpActRecord.IsRecordType(this))
     {
         return(typeof(NdefSpActRecord));
     }
     if (NdefSpSizeRecord.IsRecordType(this))
     {
         return(typeof(NdefSpSizeRecord));
     }
     if (NdefSpMimeTypeRecord.IsRecordType(this))
     {
         return(typeof(NdefSpMimeTypeRecord));
     }
     if (NdefLaunchAppRecord.IsRecordType(this))
     {
         return(typeof(NdefLaunchAppRecord));
     }
     if (NdefAndroidAppRecord.IsRecordType(this))
     {
         return(typeof(NdefAndroidAppRecord));
     }
     if (NdefVcardRecordBase.IsRecordType(this))
     {
         return(typeof(NdefVcardRecordBase));
     }
     if (NdefIcalendarRecordBase.IsRecordType(this))
     {
         return(typeof(NdefIcalendarRecordBase));
     }
     if (NdefBtSecureSimplePairingRecord.IsRecordType(this))
     {
         return(typeof(NdefBtSecureSimplePairingRecord));
     }
     if (NdefHandoverSelectRecord.IsRecordType(this))
     {
         return(typeof(NdefHandoverSelectRecord));
     }
     if (NdefHandoverErrorRecord.IsRecordType(this))
     {
         return(typeof(NdefHandoverErrorRecord));
     }
     if (NdefHandoverAlternativeCarrierRecord.IsRecordType(this))
     {
         return(typeof(NdefHandoverAlternativeCarrierRecord));
     }
     if (NdefMimeImageRecordBase.IsRecordType(this))
     {
         return(typeof(NdefMimeImageRecordBase));
     }
     return(typeof(NdefRecord));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Add another Alternative Carrier record as a child and create the storage list if
 /// necessary. Also automatically updates the payload.
 /// </summary>
 /// <param name="newRecord">Additional Alternative Carrier record to add to the list
 /// for use as children of the Handover Select record.</param>
 public void AddHandoverAlternativeCarrierRecord(NdefHandoverAlternativeCarrierRecord newRecord)
 {
     if (_handoverAlternativeCarrierRecords == null)
     {
         _handoverAlternativeCarrierRecords = new List<NdefHandoverAlternativeCarrierRecord>();
     }
     _handoverAlternativeCarrierRecords.Add(newRecord);
     AssemblePayload();
 }