示例#1
0
 /// <summary>
 /// Constructor for the <see cref="CsModel"/>
 /// </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="modelType">The type of code model created.</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>
 protected CsModel(bool isLoaded, bool hasErrors, bool loadedFromSource, SourceCodeType language, CsModelType modelType, string sourceDocument = null, ModelStore <ICsModel> modelStore = null, IReadOnlyList <ModelLoadException> modelErrors = null)
 {
     _isLoaded         = isLoaded;
     _hasErrors        = hasErrors;
     _loadedFromSource = loadedFromSource;
     _language         = language;
     _sourceDocument   = sourceDocument;
     _modelType        = modelType;
     ModelStore        = modelStore;
     LocalModelErrors  = modelErrors ?? ImmutableList <ModelLoadException> .Empty;
 }
 /// <summary>
 /// Constructor for the <see cref="CsMember"/>
 /// </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="memberType">The type of member this model represents.</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="modelType">The type of model that represents this member.</param>
 /// <param name="attributes">List of the attributes assigned to this model.</param>
 /// <param name="sourceFiles">List of the fully qualified paths to the source code files this member is defined in.</param>
 /// <param name="hasDocumentation">Flag that determines if the model has XML documentation assigned to it.</param>
 /// <param name="documentation">The xml documentation assigned to the model.</param>
 /// <param name="lookupPath">The fully qualified model lookup path for this model.</param>
 /// <param name="name">The name of the model.</param>
 /// <param name="parentPath">THe fully qualified lookup path for the parent model to this one.</param>
 /// <param name="security">The security scope assigned to this model.</param>
 protected CsMember(bool isLoaded, bool hasErrors, bool loadedFromSource, SourceCodeType language, CsModelType modelType,
                    IReadOnlyList <CsAttribute> attributes, IReadOnlyList <string> sourceFiles, bool hasDocumentation,
                    string documentation, string lookupPath, string name, string parentPath, CsSecurity security,
                    CsMemberType memberType, string sourceDocument = null, ModelStore <ICsModel> modelStore = null, IReadOnlyList <ModelLoadException> modelErrors = null)
     : base(isLoaded, hasErrors, loadedFromSource, language, modelType, sourceDocument, modelStore, modelErrors)
 {
     _attributes       = attributes ?? ImmutableList <CsAttribute> .Empty;
     _sourceFiles      = sourceFiles ?? ImmutableList <string> .Empty;
     _hasDocumentation = hasDocumentation;
     _documentation    = documentation;
     _lookupPath       = lookupPath;
     _name             = name;
     _parentPath       = parentPath;
     _security         = security;
     _memberType       = memberType;
 }
示例#3
0
 /// <summary>
 /// Constructor for the <see cref="CsGenericParameter"/>
 /// </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="modelType">The type of code model created.</param>
 /// <param name="hasOutKeyword">Flag that determines if parameter has out keyword assigned.</param>
 /// <param name="hasNewConstraint">Flag that determines if generic parameter supports new keyword.</param>
 /// <param name="hasClassConstraint">flag that determines if the generic parameter has a constraint requirement to classes.</param>
 /// <param name="hasStructConstraint">Flag that determines if the generic parameter has a constraint requirement to structures.</param>
 /// <param name="hasConstraintTypes">Flag that determines if the generic parameter has additional type constraints.</param>
 /// <param name="constrainingTypes">List of of additional constraints the generic parameter supports.</param>
 /// <param name="type">The type definition for the generic type</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>
 protected CsGenericParameter(bool isLoaded, bool hasErrors, bool loadedFromSource, SourceCodeType language, CsModelType modelType,
                              bool hasOutKeyword, bool hasNewConstraint, bool hasClassConstraint, bool hasStructConstraint,
                              bool hasConstraintTypes, IReadOnlyList <CsType> constrainingTypes, CsType type, string sourceDocument = null, ModelStore <ICsModel> modelStore = null, IReadOnlyList <ModelLoadException> modelErrors = null)
     : base(isLoaded, hasErrors, loadedFromSource, language, modelType, sourceDocument, modelStore, modelErrors)
 {
     _hasOutKeyword       = hasOutKeyword;
     _hasNewConstraint    = hasNewConstraint;
     _hasClassConstraint  = hasClassConstraint;
     _hasStructConstraint = hasStructConstraint;
     _hasConstraintTypes  = hasConstraintTypes;
     _constrainingTypes   = constrainingTypes ?? ImmutableList <CsType> .Empty;
     _type = type;
 }
 /// <summary>
 /// Constructor for the <see cref="CsContainer"/>
 /// </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="modelType">The type of code model created.</param>
 /// <param name="members">The members assigned to this container.</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="attributes">List of the attributes assigned to this model.</param>
 /// <param name="isGeneric">Flag that determines if the container is a generic definition.</param>
 /// <param name="hasStrongTypesInGenerics">Flag that determines if the generics use strong type definitions.</param>
 /// <param name="genericParameters">Generic parameters assigned to the container.</param>
 /// <param name="genericTypes">Target types for the generic parameters assigned to the container.</param>
 /// <param name="sourceFiles">List of the fully qualified paths to the source code files this model is defined in.</param>
 /// <param name="hasDocumentation">Flag that determines if the model has XML documentation assigned to it.</param>
 /// <param name="documentation">The xml documentation assigned to the model.</param>
 /// <param name="lookupPath">The fully qualified model lookup path for this model.</param>
 /// <param name="name">The name of the model.</param>
 /// <param name="ns">The namespace the container belongs to.</param>
 /// <param name="parentPath">The fully qualified lookup path for the parent model to this one.</param>
 /// <param name="containerType">The type of container this model represents.</param>
 /// <param name="security">The security scope assigned to this model.</param>
 /// <param name="inheritedInterfaces">The interfaces that are inherited by this container.</param>
 protected CsContainer(bool isLoaded, bool hasErrors, bool loadedFromSource, SourceCodeType language, CsModelType modelType,
                       IReadOnlyList <CsAttribute> attributes, bool isGeneric, bool hasStrongTypesInGenerics,
                       IReadOnlyList <CsGenericParameter> genericParameters, IReadOnlyList <CsType> genericTypes,
                       IReadOnlyList <string> sourceFiles, bool hasDocumentation, string documentation, string lookupPath,
                       string name, string ns, string parentPath, CsContainerType containerType, CsSecurity security,
                       IReadOnlyList <CsInterface> inheritedInterfaces, IReadOnlyList <CsMember> members,
                       string sourceDocument = null, ModelStore <ICsModel> modelStore = null, IReadOnlyList <ModelLoadException> modelErrors = null)
     : base(isLoaded, hasErrors, loadedFromSource, language, modelType, sourceDocument, modelStore, modelErrors)
 {
     _attributes = attributes ?? ImmutableList <CsAttribute> .Empty;
     _isGeneric  = isGeneric;
     _hasStrongTypesInGenerics = hasStrongTypesInGenerics;
     _genericParameters        = genericParameters ?? ImmutableList <CsGenericParameter> .Empty;
     _genericTypes             = genericTypes ?? ImmutableList <CsType> .Empty;
     _sourceFiles      = sourceFiles ?? ImmutableList <string> .Empty;
     _hasDocumentation = hasDocumentation;
     _documentation    = documentation;
     _lookupPath       = lookupPath;
     _name             = name;
     _ns                  = ns;
     _parentPath          = parentPath;
     _containerType       = containerType;
     _security            = security;
     _inheritedInterfaces = inheritedInterfaces ?? ImmutableList <CsInterface> .Empty;
     _members             = members ?? ImmutableList <CsMember> .Empty;
 }