private Func <ApiMutableSchema, ApiMutableEnumerationValue> CreateApiMutableEnumerationValueFactory(string clrName, int clrOrdinal)
        {
            Contract.Requires(clrName.SafeHasContent());

            ApiMutableEnumerationValue ApiMutableEnumerationValueFactory(ApiMutableSchema apiMutableSchema)
            {
                Contract.Requires(clrName.SafeHasContent());

                // Apply conventions
                this.ApiPrecedenceStack.Push(ApiPrecedenceLevel.Convention);

                var apiConventionSet      = apiMutableSchema?.ApiConventionSet;
                var apiConventionSettings = apiMutableSchema?.ApiConventionSettings;

                this.ApplyApiEnumerationValueNameConventions(clrName, apiConventionSet, apiConventionSettings);

                this.ApiPrecedenceStack.Pop();

                // Create API scalar type context
                var apiDefaultName             = clrName;
                var apiMutableEnumerationValue = new ApiMutableEnumerationValue
                {
                    ApiName    = apiDefaultName,
                    ClrName    = clrName,
                    ClrOrdinal = clrOrdinal
                };

                return(apiMutableEnumerationValue);
            }

            return(ApiMutableEnumerationValueFactory);
        }
        private static IApiEnumerationValue CreateApiEnumerationValue(ApiMutableEnumerationValue apiMutableEnumerationValue)
        {
            Contract.Requires(apiMutableEnumerationValue != null);

            var apiName             = apiMutableEnumerationValue.ApiName;
            var apiDescription      = apiMutableEnumerationValue.ApiDescription;
            var clrName             = apiMutableEnumerationValue.ClrName;
            var clrOrdinal          = apiMutableEnumerationValue.ClrOrdinal;
            var apiEnumerationValue = ApiTypeFactory.CreateApiEnumerationValue(apiName, apiDescription, clrName, clrOrdinal);

            return(apiEnumerationValue);
        }