internal static ChangeContexts ChangeContextFromExtraRequirementsSetContext(ExtraRequirementsSetContexts sc) // Static. { switch (sc) { case ExtraRequirementsSetContexts.UI: return ChangeContexts.UI; case ExtraRequirementsSetContexts.Drop: return ChangeContexts.Drop; } return ChangeContexts.Program; }
/// <summary> /// Extra requirements are a way of specifying extra functionality on parameters in the automatic UI. /// Implement this function to support values being set from automatic UI sections or the texture summary. /// See IAutoUIExtraRequirements.h in the C++ RDK for string definitions for the parameter names. /// </summary> /// <param name="parameterName">The parameter or field internal name to which this query applies</param> /// <param name="childSlotName">The extra requirement parameter, as listed in IAutoUIExtraRequirements.h in the C++ RDK</param> /// <param name="value">The value to set this extra requirement parameter. You will typically use System.Convert to convert the value to the type you need</param> /// <param name="sc">The context of this operation.</param> /// <returns>Null variant if not supported. Call the base class if you do not support the extra requirement paramter.</returns> public virtual bool SetChildSlotParameter(String parameterName, String childSlotName, object value, ExtraRequirementsSetContexts sc) { Variant v = value as Variant; if (v != null) { if (IsNativeWrapper()) { return 1 == UnsafeNativeMethods.Rdk_RenderContent_SetExtraRequirementParameter(ConstPointer(), parameterName, childSlotName, v.ConstPointer(), (int)sc); } string key = BindingKey(parameterName, childSlotName); BoundField bound_field; if (m_bound_parameters.TryGetValue(key, out bound_field)) { bound_field.Field.Set(v, bound_field.ChangeContexts); return true; } else return 1 == UnsafeNativeMethods.Rdk_RenderContent_CallSetExtraRequirementParameterBase(ConstPointer(), parameterName, childSlotName, v.ConstPointer(), (int)sc); } return false; }