Exemplo n.º 1
0
        // ---- METHODS (INTERNAL) -------------------------------------------------------------------------------------

        /// <summary>
        /// Gets the <see cref="Guid"/> with which the <see cref="KnownFolderType"/> enumeration member has been
        /// decorated.
        /// </summary>
        /// <param name="value">The decorated <see cref="KnownFolderType"/> enumeration member.</param>
        /// <returns>The <see cref="Guid"/> of the <see cref="KnownFolderType"/>.</returns>
        internal static Guid GetGuid(this KnownFolderType value)
        {
            FieldInfo member = typeof(KnownFolderType).GetField(value.ToString());

            object[] attributes = member.GetCustomAttributes(typeof(KnownFolderGuidAttribute), false);
            KnownFolderGuidAttribute guidAttribute = (KnownFolderGuidAttribute)attributes[0];

            return(guidAttribute.Guid);
        }
Exemplo n.º 2
0
        // ---- METHODS (INTERNAL) -------------------------------------------------------------------------------------

        /// <summary>
        /// Gets the <see cref="Guid"/> with which the <see cref="KnownFolderType"/> enumeration member has been
        /// decorated.
        /// </summary>
        /// <param name="Value">The decorated <see cref="KnownFolderType"/> enumeration member.</param>
        /// <returns>The <see cref="Guid"/> of the <see cref="KnownFolderType"/>.</returns>
        internal static Guid GetGuid(this KnownFolderType Value)
        {
            FieldInfo Member = typeof(KnownFolderType).GetField(Value.ToString());

            object[] Attributes = Member.GetCustomAttributes(typeof(KnownFolderGuidAttribute), false);
            KnownFolderGuidAttribute GuidAttribute = (KnownFolderGuidAttribute)Attributes[0];

            return(GuidAttribute.Guid);
        }