TnefNameId Structure

A TNEF name identifier.

Definition

Namespace: MimeKit.Tnef
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public readonly struct TnefNameId : IEquatable<TnefNameId>
Inheritance
Object    ValueType    TnefNameId
Implements
IEquatableTnefNameId

Remarks

A TNEF name identifier.

Example

C#
                    public static void PrintMessageProperties (string fileName)
{
    using (var stream = File.OpenRead (fileName))
    using (var tnef = TnefMessage.Load (stream)) {
        // The most commonly used properties have convenience accessors.
        Console.WriteLine ("Message-Class: {0}", tnef.MessageClass);
        Console.WriteLine ("Subject: {0}", tnef.Subject);
        Console.WriteLine ("Message-Id: {0}", tnef.InternetMessageId);

        // Any other property may be looked up by its tag. Note that a string lookup matches both the
        // String8 and the Unicode variant of the property tag.
        var sender = tnef.Properties.GetString (TnefPropertyTag.SenderEmailAddressW);
        var submitted = tnef.Properties.GetDateTime (TnefPropertyTag.ClientSubmitTime);
        var importance = tnef.Properties.GetInt32 (TnefPropertyTag.Importance);

        Console.WriteLine ("Sender: {0}", sender);
        Console.WriteLine ("Submitted: {0} (UTC)", submitted);
        Console.WriteLine ("Importance: {0}", importance);

        // Named properties are looked up by their TnefNameId.
        if (tnef.Properties.TryGetValue (TnefNameId.Location, out var location) && location.TryGetString (out var where))
            Console.WriteLine ("Location: {0}", where);

        // Multi-valued properties have more than one value.
        if (tnef.Properties.TryGetValue (TnefNameId.Keywords, out var keywords) && keywords.TryGetValues<string> (out var categories))
            Console.WriteLine ("Categories: {0}", string.Join (", ", categories));

        // Or simply enumerate every property.
        foreach (var property in tnef.Properties) {
            var name = property.Name.HasValue ? property.Name.Value.ToString () : property.Tag.Id.ToString ();
            var value = property.Value;

            if (value is byte[] bytes)
                value = string.Format ("<{0} bytes>", bytes.Length);
            else if (value is Array array)
                value = string.Join (", ", array.Cast<object> ());

            Console.WriteLine ("{0} ({1}) = {2}", name, property.PropertyType, value);
        }
    }
}
                  

Constructors

TnefNameId(Guid, Int32) Initialize a new instance of the TnefNameId struct.
TnefNameId(Guid, String) Initialize a new instance of the TnefNameId struct.

Properties

Id Get the identifier, if available.
Kind Get the kind of TNEF name identifier.
Name Get the name, if available.
PropertySetGuid Get the property set GUID.

Methods

Equals(Object) Determine whether the specified Object is equal to the current TnefNameId.
(Overrides ValueTypeEquals(Object))
Equals(TnefNameId) Determine whether the specified TnefNameId is equal to the current TnefNameId.
GetHashCode Serves as a hash function for a TnefNameId object.
(Overrides ValueTypeGetHashCode)
GetType Gets the Type of the current instance.
(Inherited from Object)
ToString Returns a String that represents the current TnefNameId.
(Overrides ValueTypeToString)

Operators

Equality(TnefNameId, TnefNameId) Compare two TnefNameId objects for equality.
Inequality(TnefNameId, TnefNameId) Compare two TnefNameId objects for inequality.

Fields

AllAttendeesString The PidLidAllAttendeesString named property.
AppointmentColor The PidLidAppointmentColor named property.
AppointmentCounterProposal The PidLidAppointmentCounterProposal named property.
AppointmentDuration The PidLidAppointmentDuration named property.
AppointmentEndWhole The PidLidAppointmentEndWhole named property.
AppointmentNotAllowPropose The PidLidAppointmentNotAllowPropose named property.
AppointmentProposedEndWhole The PidLidAppointmentProposedEndWhole named property.
AppointmentProposedStartWhole The PidLidAppointmentProposedStartWhole named property.
AppointmentRecur The PidLidAppointmentRecur named property.
AppointmentSequence The PidLidAppointmentSequence named property.
AppointmentStartWhole The PidLidAppointmentStartWhole named property.
AppointmentStateFlags The PidLidAppointmentStateFlags named property.
AppointmentSubType The PidLidAppointmentSubType named property.
AppointmentTimeZoneDefinitionEndDisplay The PidLidAppointmentTimeZoneDefinitionEndDisplay named property.
AppointmentTimeZoneDefinitionRecur The PidLidAppointmentTimeZoneDefinitionRecur named property.
AppointmentTimeZoneDefinitionStartDisplay The PidLidAppointmentTimeZoneDefinitionStartDisplay named property.
AttachmentMacContentType The PidNameAttachmentMacContentType named property.
AttachmentMacInfo The PidNameAttachmentMacInfo named property.
AttachmentOriginalPermissionType The PidNameAttachmentOriginalPermissionType named property.
AttachmentPermissionType The PidNameAttachmentPermissionType named property.
AttachmentProviderType The PidNameAttachmentProviderType named property.
AttendeeCriticalChange The PidLidAttendeeCriticalChange named property.
BusyStatus The PidLidBusyStatus named property.
CcAttendeesString The PidLidCcAttendeesString named property.
Classified The PidLidClassified named property.
CleanGlobalObjectId The PidLidCleanGlobalObjectId named property.
ClipEnd The PidLidClipEnd named property.
ClipStart The PidLidClipStart named property.
CommonEnd The PidLidCommonEnd named property.
CommonStart The PidLidCommonStart named property.
Companies The PidLidCompanies named property.
Contacts The PidLidContacts named property.
CurrentVersion The PidLidCurrentVersion named property.
CurrentVersionName The PidLidCurrentVersionName named property.
Email1AddressType The PidLidEmail1AddressType named property.
Email1DisplayName The PidLidEmail1DisplayName named property.
Email1EmailAddress The PidLidEmail1EmailAddress named property.
ExceptionReplaceTime The PidLidExceptionReplaceTime named property.
FileUnder The PidLidFileUnder named property.
FlagRequest The PidLidFlagRequest named property.
GlobalObjectId The PidLidGlobalObjectId named property.
IntendedBusyStatus The PidLidIntendedBusyStatus named property.
InternetAccountName The PidLidInternetAccountName named property.
InternetAccountStamp The PidLidInternetAccountStamp named property.
IsException The PidLidIsException named property.
IsRecurring The PidLidIsRecurring named property.
Keywords The PidNameKeywords named property.
Location The PidLidLocation named property.
MeetingType The PidLidMeetingType named property.
OwnerCriticalChange The PidLidOwnerCriticalChange named property.
PercentComplete The PidLidPercentComplete named property.
Private The PidLidPrivate named property.
RecurrencePattern The PidLidRecurrencePattern named property.
RecurrenceType The PidLidRecurrenceType named property.
Recurring The PidLidRecurring named property.
ReminderDelta The PidLidReminderDelta named property.
ReminderFileParameter The PidLidReminderFileParameter named property.
ReminderOverride The PidLidReminderOverride named property.
ReminderPlaySound The PidLidReminderPlaySound named property.
ReminderSet The PidLidReminderSet named property.
ReminderSignalTime The PidLidReminderSignalTime named property.
ReminderTime The PidLidReminderTime named property.
ResponseStatus The PidLidResponseStatus named property.
SideEffects The PidLidSideEffects named property.
SmartNoAttach The PidLidSmartNoAttach named property.
StartRecurrenceDate The PidLidStartRecurrenceDate named property.
StartRecurrenceTime The PidLidStartRecurrenceTime named property.
TaskAssigner The PidLidTaskAssigner named property.
TaskComplete The PidLidTaskComplete named property.
TaskDateCompleted The PidLidTaskDateCompleted named property.
TaskDueDate The PidLidTaskDueDate named property.
TaskMode The PidLidTaskMode named property.
TaskOwner The PidLidTaskOwner named property.
TaskStartDate The PidLidTaskStartDate named property.
TaskStatus The PidLidTaskStatus named property.
TimeZoneDescription The PidLidTimeZoneDescription named property.
TimeZoneStruct The PidLidTimeZoneStruct named property.
ToAttendeesString The PidLidToAttendeesString named property.
ToDoTitle The PidLidToDoTitle named property.
UseTnef The PidLidUseTnef named property.

See Also