示例#1
0
 /// <summary>
 /// Constructor for the <see cref="CsAttributeParameter"/>
 /// </summary>
 /// <param name="isLoaded">Flag that determines if the model was loaded.</param>
 /// <param name="hasErrors">Flag that determine if errors were found creating the model.</param>
 /// <param name="loadedFromSource">Flag that determines if the model was loaded from source code or from an existing library.</param>
 /// <param name="language">The target language the model was generated from.</param>
 /// <param name="value">The value assigned to the parameter.</param>
 /// <param name="sourceDocument">The source document that was used to build this model. This is optional parameter and can be null.</param>
 /// <param name="modelStore">Optional the lookup storage for models created during the compile or lookup of the model.</param>
 /// <param name="modelErrors">Optional the error that occured while creating the model.</param>
 /// <param name="hasNamedParameter">Flag that determines if the attribute parameter is a named parameter.</param>
 /// <param name="name">The name of the parameter, should be null if not named.</param>
 protected CsAttributeParameter(bool isLoaded, bool hasErrors, bool loadedFromSource, SourceCodeType language,
                                bool hasNamedParameter, string name, CsAttributeParameterValue value, string sourceDocument = null, ModelStore <ICsModel> modelStore = null, IReadOnlyList <ModelLoadException> modelErrors = null)
     : base(isLoaded, hasErrors, loadedFromSource, language, CsModelType.AttributeParameter, sourceDocument, modelStore, modelErrors)
 {
     _hasNamedParameter = hasNamedParameter;
     _name  = name;
     _value = value;
 }
        /// <summary>
        /// Creates the implementation of an attribute value formatted for c#.
        /// </summary>
        /// <param name="source">The source value to format.</param>
        /// <returns>The formatted value, or null if the model does not exist.</returns>
        public static string FormatCSharpAttributeParameterValueSignatureSyntax(this CsAttributeParameterValue source)
        {
            var dotNetAttributeParameterValue = source as IDotNetAttributeParameterValue;

            return(dotNetAttributeParameterValue.FormatCSharpAttributeParameterValueSignatureSyntax());
        }