本文整理汇总了C#中QuickFix.setField方法的典型用法代码示例。如果您正苦于以下问题:C# QuickFix.setField方法的具体用法?C# QuickFix.setField怎么用?C# QuickFix.setField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QuickFix
的用法示例。
在下文中一共展示了QuickFix.setField方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: toAdmin
public override void toAdmin(QuickFix.Message message, QuickFix.SessionID sessionID)
{
base.toAdmin(message, sessionID);
if (message is QuickFix42.Logon)
{
message.setField(new ResetSeqNumFlag(true));
GSFIX gsfix = provider as GSFIX;
string encrypt_pwd = gsfix.Password;
byte[] encrypt_pwd_byte = new byte[128];
switch (gsfix.EncryptType)
{
case EncryptType.NONE:
message.setField(new EncryptMethod(EncryptMethod.NONE));
break;
case EncryptType.DESECB:
gsEncrypt(2, gsfix.Password, gsfix.Password.Length, gsfix.PublicKey, encrypt_pwd_byte, 128);
encrypt_pwd = Encoding.ASCII.GetString(encrypt_pwd_byte);
message.setField(new EncryptMethod(EncryptMethod.DESECBMODE));
break;
case EncryptType.BlowFish:
gsEncrypt(101, gsfix.Password, gsfix.Password.Length, gsfix.PublicKey, encrypt_pwd_byte, 128);
encrypt_pwd = Encoding.ASCII.GetString(encrypt_pwd_byte);
message.setField(new EncryptMethod((int)EncryptType.BlowFish));
break;
default:
break;
}
if (!string.IsNullOrEmpty(gsfix.Account) && !string.IsNullOrEmpty(gsfix.CreditAccount))
{
message.setField(new RawData(string.Format("T:{0},{1}:{2}:", gsfix.Account, gsfix.CreditAccount, encrypt_pwd.ToString())));
}
else if (!string.IsNullOrEmpty(gsfix.Account))
{
message.setField(new RawData(string.Format("Z:{0}:{1}:", gsfix.Account, encrypt_pwd.ToString())));
}
else if (!string.IsNullOrEmpty(gsfix.CreditAccount))
{
message.setField(new RawData(string.Format("X:{0}:{1}:", gsfix.CreditAccount, encrypt_pwd.ToString())));
}
else
{
message.setField(new RawData(string.Format("T:{0},{1}:{2}:", gsfix.Account, gsfix.CreditAccount, encrypt_pwd.ToString())));
}
}
}
示例2: fillFixMessageStructure
private static void fillFixMessageStructure(Dictionary<EFixTags,string> tagMap, ref QuickFix.Message fixMessage)
{
foreach (KeyValuePair<EFixTags, string> kvp in tagMap)
{
Fix.Out(string.Format("Tag {0}: {1}={2}", (int)kvp.Key, kvp.Key.ToString(), kvp.Value));
fixMessage.setField((int)kvp.Key, kvp.Value);
}
}
示例3: SetUserDefinedFields
protected void SetUserDefinedFields(FIXMessage Message, QuickFix.Message message)
{
foreach (FIXField fixField in Message.Fields)
{
if (fixField.Tag >= 500)
{
switch (fixField.FIXType)
{
case FIXType.Bool:
message.setField(new BooleanField(fixField.Tag, ((FIXBoolField)fixField).Value));
continue;
case FIXType.Int:
message.setField(new IntField(fixField.Tag, ((FIXIntField)fixField).Value));
continue;
case FIXType.Double:
message.setField(new DoubleField(fixField.Tag, ((FIXDoubleField)fixField).Value));
continue;
case FIXType.Char:
message.setField(new CharField(fixField.Tag, ((FIXCharField)fixField).Value));
continue;
case FIXType.String:
message.setField(new StringField(fixField.Tag, ((FIXStringField)fixField).Value));
continue;
case FIXType.DateTime:
message.setField((UtcDateOnlyField)new UtcDateField(fixField.Tag, ((FIXDateTimeField)fixField).Value));
continue;
default:
continue;
}
}
}
}