/// ////////////////////////////////////////////// public void TraiteType(ref Type tp) { string strType = ""; switch (Mode) { case ModeSerialisation.Ecriture: //Stef, 25/07/08, stocke le nom de l'assembly avec strType = CActivatorSurChaine.GetNomTypeAvecAssembly(tp); TraiteString(ref strType); break; case ModeSerialisation.Lecture: TraiteString(ref strType); try { tp = null; tp = CActivatorSurChaine.GetType(strType); } catch { } if (tp == null && strType.Length > 0) { Console.WriteLine(I.T("Cannot allocate type @1 in C2iSerializer.TraiteType|30110", strType)); } break; } }
//----------------------------------------------------- internal static Type GetType(string strId) { Type tp = null; m_dicTypeIdToType.TryGetValue(strId, out tp);//s'il n'y est pas, c'est qu'il n'existe pas car le dic est toujours à jours if (tp == null) { return(CActivatorSurChaine.GetType(strId, false, false)); } return(tp); }
public static void Autoexec() { foreach (Assembly ass in CGestionnaireAssemblies.GetAssemblies()) { foreach (Type tp in ass.GetTypes()) { object[] attrs = tp.GetCustomAttributes(typeof(ReplaceClassAttribute), false); if (attrs != null) { foreach (ReplaceClassAttribute attr in attrs) { CActivatorSurChaine.RegisterTypeObsolete(attr.URITypeRemplace, tp); } } } } }