public override bool StringToType(string typestring, out Type type) { typestring = typestring.ToLowerInvariant(); if (FMappings.ContainsKey(typestring)) { type = FMappings[typestring]; return(true); } else { foreach (var a in AppDomain.CurrentDomain.GetAssemblies()) { try { if (!a.IsDynamic) { type = a.GetType(typestring, false, true); //static is also abstract&sealed // \..\ is an exception to avoid loading from falsly loaded assemblies (notui) if (type != null && (!type.IsAbstract) && (!a.Location.Contains(@"\..\"))) { FMappings.Add(type.FullName.ToLower(), type); return(true); } } } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e); } } type = null; return(false); } }
public DX11FieldtypeRegistry() : base() { FMappings.Add("dx11renderstate", typeof(DX11RenderState)); FMappings.Add("dx11samplerstates", typeof(DX11SamplerStates)); FMappings.Add("dx11rendersemantic", typeof(IDX11RenderSemantic)); FMappings.Add("dx11objectvalidator", typeof(IDX11ObjectValidator)); }
public DX11GraphPartFieldtypeRegistry() : base() { FMappings.Add("dx11layer", typeof(DX11Resource <DX11Layer>)); FMappings.Add("dx11geometry", typeof(DX11Resource <IDX11Geometry>)); FMappings.Add("dx11texture1d", typeof(DX11Resource <DX11Texture1D>)); FMappings.Add("dx11texture2d", typeof(DX11Resource <DX11Texture2D>)); FMappings.Add("dx11texture3d", typeof(DX11Resource <DX11Texture3D>)); FMappings.Add("dx11buffer", typeof(DX11Resource <IDX11ReadableResource>)); }
public PrimitivesFieldTypeRegistry() : base() { FMappings.Add("bool", typeof(bool)); FMappings.Add("int", typeof(int)); FMappings.Add("double", typeof(double)); FMappings.Add("value", typeof(double)); FMappings.Add("float", typeof(float)); FMappings.Add("string", typeof(string)); FMappings.Add("text", typeof(string)); FMappings.Add("color", typeof(RGBAColor)); FMappings.Add("rgbacolor", typeof(RGBAColor)); FMappings.Add("vector2d", typeof(Vector2D)); FMappings.Add("vector3d", typeof(Vector3D)); FMappings.Add("vector4d", typeof(Vector4D)); FMappings.Add("vector2", typeof(Vector2D)); FMappings.Add("vector3", typeof(Vector3D)); FMappings.Add("vector4", typeof(Vector4D)); FMappings.Add("matrix", typeof(Matrix4x4)); FMappings.Add("matrix4", typeof(Matrix4x4)); FMappings.Add("matrix4x4", typeof(Matrix4x4)); FMappings.Add("transform", typeof(Matrix4x4)); FMappings.Add("stream", typeof(Stream)); FMappings.Add("raw", typeof(Stream)); FMappings.Add("struct", typeof(Core.Struct)); FMappings.Add("xnode", typeof(XNode)); FMappings.Add("xelement", typeof(XElement)); FMappings.Add("xattribute", typeof(XAttribute)); FMappings.Add("mouse", typeof(Mouse)); FMappings.Add("keyboard", typeof(Keyboard)); FMappings.Add("touch", typeof(TouchDevice)); FMappings.Add("gesture", typeof(GestureDevice)); //FMappings.Add("enum", typeof(EnumEntry)); }