public static CSF Create(Stream stream, string id) { CSF result = null; uint hash = Hash.GetHash(id); if ((result = LocalizedString.Localizers.Find(x => x.Id == hash)) == null) { byte[] buffer = new byte[stream.Length]; stream.Read(buffer, 0, buffer.Length); result = new CSF(buffer, hash, id); } else { Tracer.GetTracer("Localizer", "").TraceInfo(GlobalData.InfoLocalizerExists, "id", id); } return result; }
public static CSF Create(byte[] buffer, string id) { CSF result = null; uint hash = Hash.GetHash(id); if ((result = LocalizedString.Localizers.Find(x => x.Id == hash)) == null) { result = new CSF(buffer, hash, id); } else { Tracer.GetTracer("Localizer", "").TraceInfo(GlobalData.ErrorLocalizerExists, "id", id); } return result; }