예제 #1
0
        internal void AddTypeToTypeManager(CodeStatementCollection dictionaryStatements, string dictionaryName)
        {
            string typeRef = string.Concat("global::", this.clrTypeInfo.clrFullTypeName);

            CodeExpression[] codeExpressionArray = new CodeExpression[] { CodeDomHelper.XNameGetExpression(this.clrTypeInfo.schemaName, this.clrTypeInfo.schemaNs), CodeDomHelper.Typeof(typeRef) };
            dictionaryStatements.Add(CodeDomHelper.CreateMethodCallFromField(dictionaryName, "Add", codeExpressionArray));
        }
        internal void AddTypeToTypeManager(CodeStatementCollection elementDictionaryStatements, CodeStatementCollection wrapperDictionaryStatements)
        {
            base.AddTypeToTypeManager(elementDictionaryStatements, "elementDictionary");
            string innerTypeFullName = null;

            if (!this.innerTypeName.Contains(this.innerTypeNs))
            {
                innerTypeFullName = string.Concat("global::", this.innerTypeNs, ".", this.innerTypeName);
            }
            CodeExpression[] codeExpressionArray = new CodeExpression[] { CodeDomHelper.Typeof(this.clrTypeInfo.clrFullTypeName), CodeDomHelper.Typeof(innerTypeFullName) };
            wrapperDictionaryStatements.Add(CodeDomHelper.CreateMethodCallFromField("wrapperDictionary", "Add", codeExpressionArray));
        }
예제 #3
0
 internal override void CreateProperty(ClrBasePropertyInfo propertyInfo, List <ClrAnnotation> annotations)
 {
     if ((!this.clrTypeInfo.InlineBaseType ? false : propertyInfo.FromBaseType))
     {
         propertyInfo.IsNew = true;
     }
     this.propertyBuilder.GenerateCode(propertyInfo, annotations);
     if ((propertyInfo.ContentType != ContentType.Property ? false : !propertyInfo.IsDuplicate))
     {
         CodeStatementCollection codeStatementCollection = this.propertyDictionaryAddStatements;
         CodeExpression[]        codeExpressionArray     = new CodeExpression[] { CodeDomHelper.XNameGetExpression(propertyInfo.SchemaName, propertyInfo.PropertyNs), CodeDomHelper.Typeof(propertyInfo.ClrTypeName) };
         codeStatementCollection.Add(CodeDomHelper.CreateMethodCallFromField("localElementDictionary", "Add", codeExpressionArray));
     }
 }