public static object GetTemplateObject(Type type) { object obj = null; if (TemplateList.TryGetValue(type.FullName, out obj)) { return(obj); } if (typeof(Component).IsAssignableFrom(type)) { obj = HostSurfaceManager.GetTemplateComponent(type); } else { obj = GetTemplateObjectFromSpecialType(type); if (obj == null) { obj = ABCDynamicInvoker.CreateInstanceObject(type); } } if (obj != null) { TemplateList.Add(type.FullName, obj); } return(obj); }