예제 #1
0
파일: XamlParser.cs 프로젝트: JianwenSun/cc
 /// <summary>
 /// Write the constructor parameter record where the parameter is a compile time
 /// resolved Type object.
 /// </summary>
 public virtual void WriteConstructorParameterType(
      XamlConstructorParameterTypeNode xamlConstructorParameterTypeNode)
 {
     if (BamlRecordWriter != null)
     {
         BamlRecordWriter.WriteConstructorParameterType(xamlConstructorParameterTypeNode);
     }
 }
예제 #2
0
 /// <summary>
 /// Write the start of a constructor parameter section 
 /// </summary>
 public override void WriteConstructorParameterType(
     XamlConstructorParameterTypeNode xamlConstructorParameterTypeNode)
 { 
     if (_styleModeStack.Mode == StyleMode.DataTypeProperty &&
         InDeferLoadedSection && 
         !_defNameFound) 
     {
         // Generate a series of baml records to use as the key for the defer loaded 
         // body of the Style in addition to generating the records to set
         // the normal constructor.
         base.WriteConstructorParameterType(xamlConstructorParameterTypeNode);
     } 
     base.WriteConstructorParameterType(xamlConstructorParameterTypeNode);
 } 
        /// <summary>
        /// Write the constructor parameter that has been resolved to a Type
        /// </summary>
        internal void WriteConstructorParameterType(
            XamlConstructorParameterTypeNode xamlConstructorParameterTypeNode)
        {
            // If we do not already have a type record for the type of this property,
            // then add a new TypeInfo record to the map table.
            short typeId;
            if (!MapTable.GetTypeInfoId(BinaryWriter,
                                        xamlConstructorParameterTypeNode.ValueTypeAssemblyName,
                                        xamlConstructorParameterTypeNode.ValueTypeFullName,
                                        out typeId))
            {
                typeId = MapTable.AddTypeInfoMap(BinaryWriter,
                                                 xamlConstructorParameterTypeNode.ValueTypeAssemblyName,
                                                 xamlConstructorParameterTypeNode.ValueTypeFullName,
                                                 xamlConstructorParameterTypeNode.ValueElementType,
                                                 string.Empty,
                                                 string.Empty);
            }


            BamlConstructorParameterTypeRecord bamlConstructor = BamlRecordManager.GetWriteRecord(
                                                          BamlRecordType.ConstructorParameterType)
                                                          as BamlConstructorParameterTypeRecord;
            bamlConstructor.TypeId = typeId;

            WriteAndReleaseRecord(bamlConstructor, xamlConstructorParameterTypeNode);
        }