예제 #1
0
 public void Set(SessionDetailsCopySessionAttributeByKeyOptions other)
 {
     if (other != null)
     {
         m_ApiVersion = SessionDetails.SessiondetailsCopysessionattributebykeyApiLatest;
         AttrKey      = other.AttrKey;
     }
 }
        /// <summary>
        /// <see cref="CopySessionAttributeByKey" /> is used to immediately retrieve a copy of session attribution from a given source such as a active session or a search result.
        /// If the call returns an <see cref="Result.Success" /> result, the out parameter, OutSessionAttribute, must be passed to <see cref="Release" /> to release the memory associated with it.
        /// <seealso cref="SessionDetailsAttribute" />
        /// <seealso cref="SessionDetailsCopySessionAttributeByKeyOptions" />
        /// <seealso cref="Release" />
        /// </summary>
        /// <param name="options">Structure containing the input parameters</param>
        /// <param name="outSessionAttribute">Out parameter used to receive the <see cref="SessionDetailsAttribute" /> structure.</param>
        /// <returns>
        /// <see cref="Result.Success" /> if the information is available and passed out in OutSessionAttribute
        /// <see cref="Result.InvalidParameters" /> if you pass a null pointer for the out parameter
        /// <see cref="Result.IncompatibleVersion" /> if the API version passed in is incorrect
        /// </returns>
        public Result CopySessionAttributeByKey(SessionDetailsCopySessionAttributeByKeyOptions options, out SessionDetailsAttribute outSessionAttribute)
        {
            System.IntPtr optionsAddress = new System.IntPtr();
            Helper.TryMarshalSet <SessionDetailsCopySessionAttributeByKeyOptionsInternal, SessionDetailsCopySessionAttributeByKeyOptions>(ref optionsAddress, options);

            var outSessionAttributeAddress = System.IntPtr.Zero;

            var funcResult = EOS_SessionDetails_CopySessionAttributeByKey(InnerHandle, optionsAddress, ref outSessionAttributeAddress);

            Helper.TryMarshalDispose(ref optionsAddress);

            if (Helper.TryMarshalGet <SessionDetailsAttributeInternal, SessionDetailsAttribute>(outSessionAttributeAddress, out outSessionAttribute))
            {
                EOS_SessionDetails_Attribute_Release(outSessionAttributeAddress);
            }

            return(funcResult);
        }