Пример #1
0
        /// <summary>
        /// Get the <see cref="CharacterAttachment"/> with the specified <paramref name="name"/>
        /// </summary>
        /// <returns>The <see cref="CharacterAttachment"/> or null if no attachment was found.</returns>
        /// <param name="name">Name of the required attachment.</param>
        public CharacterAttachment GetAttachment(string name)
        {
            if (_attachmentManager == null)
            {
                _attachmentManager = NativeHandle.GetIAttachmentManager();
            }

            var nativeAttachment = _attachmentManager.GetInterfaceByName(name);

            if (nativeAttachment == null)
            {
                return(null);
            }
            return(new CharacterAttachment(nativeAttachment));
        }