Ejemplo n.º 1
0
 /// <summary>
 /// call the appropriate mapping action, if the CLS type is System.Object
 /// </summary>
 /// <returns>
 /// an optional result of the mapping, some implementation of MappingAction will return null here
 /// </returns>
 private object CallActionForDNObject(ref Type clsType, ref AttributeExtCollection modifiedAttributes, MappingAction action) {
     // distinguis the different cases here
     Attribute typeAttr;
     modifiedAttributes = modifiedAttributes.RemoveAttributeOfType(s_objectIdlTypeAttrType, out typeAttr);               
     IdlTypeObject oType = IdlTypeObject.Any;
     if (typeAttr != null) { 
         oType = ((ObjectIdlTypeAttribute)typeAttr).IdlType;
     }
     switch (oType) {
         case IdlTypeObject.Any: 
             return action.MapToIdlAny(clsType);
         case IdlTypeObject.AbstractBase:
             return action.MapToAbstractBase(clsType);
         case IdlTypeObject.ValueBase:
             return action.MapToValueBase(clsType);
         default: 
             // unknown object attribute value: oType
             throw new MARSHAL(18807, CompletionStatus.Completed_MayBe);
     }
 }