コード例 #1
0
 public void Set(ActiveSessionCopyInfoOptions other)
 {
     if (other != null)
     {
         m_ApiVersion = ActiveSession.ActivesessionCopyinfoApiLatest;
     }
 }
コード例 #2
0
        /// <summary>
        /// <see cref="CopyInfo" /> is used to immediately retrieve a copy of active session information
        /// If the call returns an <see cref="Result.Success" /> result, the out parameter, OutActiveSessionInfo, must be passed to <see cref="Release" /> to release the memory associated with it.
        /// <seealso cref="ActiveSessionInfo" />
        /// <seealso cref="ActiveSessionCopyInfoOptions" />
        /// <seealso cref="Release" />
        /// </summary>
        /// <param name="options">Structure containing the input parameters</param>
        /// <param name="outActiveSessionInfo">Out parameter used to receive the <see cref="ActiveSessionInfo" /> structure.</param>
        /// <returns>
        /// <see cref="Result.Success" /> if the information is available and passed out in OutActiveSessionInfo
        /// <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 CopyInfo(ActiveSessionCopyInfoOptions options, out ActiveSessionInfo outActiveSessionInfo)
        {
            System.IntPtr optionsAddress = new System.IntPtr();
            Helper.TryMarshalSet <ActiveSessionCopyInfoOptionsInternal, ActiveSessionCopyInfoOptions>(ref optionsAddress, options);

            var outActiveSessionInfoAddress = System.IntPtr.Zero;

            var funcResult = EOS_ActiveSession_CopyInfo(InnerHandle, optionsAddress, ref outActiveSessionInfoAddress);

            Helper.TryMarshalDispose(ref optionsAddress);

            if (Helper.TryMarshalGet <ActiveSessionInfoInternal, ActiveSessionInfo>(outActiveSessionInfoAddress, out outActiveSessionInfo))
            {
                EOS_ActiveSession_Info_Release(outActiveSessionInfoAddress);
            }

            return(funcResult);
        }