public ILayerHandler GetLayerHandlerInstance(string key) { if (LayerHandlers.ContainsKey(key)) { return(GetLayerHandlerInstance(LayerHandlers[key])); } return(null); }
/// <summary> /// Manually registers a layer. Only needed externally. /// </summary> public bool RegisterLayer <T>() where T : ILayerHandler { var t = typeof(T); if (LayerHandlers.ContainsKey(t)) { return(false); } var meta = t.GetCustomAttribute <LayerHandlerMetaAttribute>() as LayerHandlerMetaAttribute; LayerHandlers.Add(t, new LayerHandlerMeta(t, meta)); return(true); }
public bool RegisterLayerHandler(LayerHandlerEntry entry, bool @default = true) { if (LayerHandlers.ContainsKey(entry.Key) || DefaultLayerHandlers.Contains(entry.Key)) { return(false); } LayerHandlers.Add(entry.Key, entry); if (@default) { DefaultLayerHandlers.Add(entry.Key); } return(true); }
public Type GetLayerHandlerType(string key) { return(LayerHandlers.ContainsKey(key) ? LayerHandlers[key].Type : null); }