private static XslCompiledTransform GetTransform(IXML t) { if (t == null) { return(null); } if (Transforms.ContainsKey(t.GetType())) { return(Transforms[t.GetType()]); } XslCompiledTransform trans = new XslCompiledTransform(); Transforms.Add(t.GetType(), trans); LoadTransform?.Invoke(trans, t); if (trans.OutputSettings == null) { throw new Exception("No Transform found for " + t.GetType()); } return(trans); }