public Message Create(string beginString, string msgType)
{
IMessageFactory f = null;
// FIXME: This is a hack. FIXT11 could mean 50 or 50sp1 or 50sp2.
// We need some way to choose which 50 version it is.
// Choosing 50 here is not adequate.
if (beginString.Equals(FixValues.BeginString.FIXT11))
{
if (!Message.IsAdminMsgType(msgType))
{
f = _factories[FixValues.BeginString.FIX50];
}
}
if (f != null) // really, this should just be in the previous if-block
{
return(f.Create(beginString, msgType));
}
if (_factories.ContainsKey(beginString) == false)
{
Message m = new Message();
m.Header.SetField(new StringField(QuickFix.Fields.Tags.MsgType, msgType));
return(m);
}
f = _factories[beginString];
return(f.Create(beginString, msgType));
}