/// <summary>
        /// Retrieves the value of an import parameter for the specified <see cref="Resource"/>.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="resource">A reference to the <see cref="Duality.Resource"/> that is parameterized.</param>
        /// <param name="parameterName">The name of the parameter.</param>
        /// <param name="value">An out reference to the variable to which the retrieved value will be assigned.</param>
        /// <returns>True, if the value was retrieved successfully. False otherwise.</returns>
        public bool GetParameter <T>(IContentRef resource, string parameterName, out T value)
        {
            // If we're importing this asset for the first time, there is no data available.
            if (!this.isReImport)
            {
                value = default(T);
                return(false);
            }

            return(AssetInternalHelper.GetAssetInfoCustomValue <T>(resource.Res, parameterName, out value));
        }
Esempio n. 2
0
 /// <summary>
 /// Retrieves the value of an export parameter for the exported <see cref="Resource"/>.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="parameterName">The name of the parameter.</param>
 /// <param name="value">An out reference to the variable to which the retrieved value will be assigned.</param>
 /// <returns>True, if the value was retrieved successfully. False otherwise.</returns>
 public bool GetParameter <T>(string parameterName, out T value)
 {
     return(AssetInternalHelper.GetAssetInfoCustomValue <T>(this.input, parameterName, out value));
 }