Ejemplo n.º 1
0
 public static BaseObject Link(NamespaceMapping aPckg, TypeMapping aType)
 {
     if (!aType.HasClassifier())
     {
         return null;
     }
     string aKey = aType.FullName;   //aPckg.FullName + "::" + aType.FullName;
     ProperRef ref2 = (ProperRef) _tabRefs[aKey];
     if (ref2 != null)
     {
         return ref2._obj;
     }
     Classifier anObj = aType.Classifier;
     BasePackage newPackage = aPckg.Package;
     BasePackage package = (BasePackage) anObj.Package;
     if (newPackage.ObjectID == package.ObjectID)
     {
         ref2 = new ProperRef(aKey, anObj);
         return anObj;
     }
     BaseObject obj2 = anObj.CreateShortcut(newPackage, "");
     ref2 = new ProperRef(aKey, obj2);
     return obj2;
 }
Ejemplo n.º 2
0
 public static TypeMapping Retrieve(TypeInfo aType, ref bool bCreate)
 {
     if (aType.IsGenericType && !aType.IsGenericTypeDefinition)
     {
         //aType = aType.GetGenericTypeDefinition();
     }
     ////if (aType.IsGenericParameter)
     ////{
     ////    return DefineExtraType(aType, aType.Name);
     ////}
     TypeMapping mapping = (TypeMapping)_tabType[aType];
     if (mapping != null)
     {
         bCreate = false;
         return mapping;
     }
     if (!bCreate)
     {
         bCreate = false;
         return null;
     }
     mapping = (TypeMapping)_tabCheck[aType.Code];
     if (mapping != null)
     {
         _tabType[aType] = mapping;
         bCreate = false;
         return mapping;
     }
     mapping = new TypeMapping(aType);
     mapping._classifier = aType.IsClass;
     bCreate = true;
     return mapping;
 }
Ejemplo n.º 3
0
 public static TypeMapping Retrieve(Type aType, ref bool bCreate)
 {
     if (aType.IsGenericType && !aType.IsGenericTypeDefinition)
     {
         aType = aType.GetGenericTypeDefinition();
     }
     if (aType.IsGenericParameter)
     {
         return DefineExtraType(aType, aType.Name);
     }
     TypeMapping mapping = (TypeMapping) _tabType[aType];
     if (mapping != null)
     {
         bCreate = false;
         return mapping;
     }
     if (!bCreate)
     {
         bCreate = false;
         return null;
     }
     mapping = (TypeMapping) _tabCheck[aType.FullName];
     if (mapping != null)
     {
         _tabType[aType] = mapping;
         bCreate = false;
         return mapping;
     }
     mapping = new TypeMapping(aType);
     bCreate = true;
     return mapping;
 }
Ejemplo n.º 4
0
 public static TypeMapping DefineExtraType(string aName)
 {
     TypeInfo aType = new TypeInfo();
     aType.Code = aType.Name = aName;
     aType.Modifier = "public";
     TypeMapping mapping = (TypeMapping)_tabType[aType];
     if (mapping == null)
     {
         mapping = new TypeMapping(aType);
         if (aName != "")
         {
             mapping._name = aName;
         }
         mapping.Complete = true;
     }
     return mapping;
 }
Ejemplo n.º 5
0
 public static TypeMapping DefineExtraType(Type aType, string aName)
 {
     TypeMapping mapping = (TypeMapping) _tabType[aType];
     if (mapping == null)
     {
         mapping = new TypeMapping(aType);
         if (aName != "")
         {
             mapping._name = aName;
         }
         mapping.Complete = true;
     }
     return mapping;
 }
Ejemplo n.º 6
0
 public static TypeMapping DefineExtraType(string aName, PdOOM.Classifier aCls)
 {
     if (aName == "")
     {
         return null;
     }
     if (aCls == null)
     {
         return null;
     }
     if (_tabCheck.Contains(aName))
     {
         return (TypeMapping) _tabCheck[aName];
     }
     TypeMapping mapping = new TypeMapping(aName);
     mapping.Classifier = aCls;
     return mapping;
 }