Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Examples deprecations & nullable-enables #889

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Examples/Executor/Examples.Executor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<RootNamespace>Executor</RootNamespace>
<AssemblyName>Executor</AssemblyName>
<Copyright>Copyright © Connamara Systems, LLC 2011</Copyright>
Expand Down
65 changes: 31 additions & 34 deletions Examples/Executor/Executor.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using QuickFix;
using QuickFix.Fields;
Expand Down Expand Up @@ -48,7 +45,7 @@ public void OnMessage(QuickFix.FIX40.NewOrderSingle n, SessionID s)
Price price = new Price(DEFAULT_MARKET_PRICE);
ClOrdID clOrdID = n.ClOrdID;

switch (ordType.getValue())
switch (ordType.Value)
{
case OrdType.LIMIT:
price = n.Price;
Expand All @@ -67,10 +64,10 @@ public void OnMessage(QuickFix.FIX40.NewOrderSingle n, SessionID s)
symbol,
side,
orderQty,
new LastShares(orderQty.getValue()),
new LastPx(price.getValue()),
new CumQty(orderQty.getValue()),
new AvgPx(price.getValue()));
new LastShares(orderQty.Value),
new LastPx(price.Value),
new CumQty(orderQty.Value),
new AvgPx(price.Value));

exReport.Set(clOrdID);

Expand Down Expand Up @@ -101,7 +98,7 @@ public void OnMessage(QuickFix.FIX41.NewOrderSingle n, SessionID s)
Price price = new Price(DEFAULT_MARKET_PRICE);
ClOrdID clOrdID = n.ClOrdID;

switch (ordType.getValue())
switch (ordType.Value)
{
case OrdType.LIMIT:
price = n.Price;
Expand All @@ -121,11 +118,11 @@ public void OnMessage(QuickFix.FIX41.NewOrderSingle n, SessionID s)
symbol,
side,
orderQty,
new LastShares(orderQty.getValue()),
new LastPx(price.getValue()),
new LastShares(orderQty.Value),
new LastPx(price.Value),
new LeavesQty(0),
new CumQty(orderQty.getValue()),
new AvgPx(price.getValue()));
new CumQty(orderQty.Value),
new AvgPx(price.Value));

exReport.Set(clOrdID);

Expand Down Expand Up @@ -156,7 +153,7 @@ public void OnMessage(QuickFix.FIX42.NewOrderSingle n, SessionID s)
ClOrdID clOrdID = n.ClOrdID;
Price price = new Price(DEFAULT_MARKET_PRICE);

switch (ordType.getValue())
switch (ordType.Value)
{
case OrdType.LIMIT:
price = n.Price;
Expand All @@ -176,13 +173,13 @@ public void OnMessage(QuickFix.FIX42.NewOrderSingle n, SessionID s)
symbol,
side,
new LeavesQty(0),
new CumQty(orderQty.getValue()),
new AvgPx(price.getValue()));
new CumQty(orderQty.Value),
new AvgPx(price.Value));

exReport.Set(clOrdID);
exReport.Set(orderQty);
exReport.Set(new LastShares(orderQty.getValue()));
exReport.Set(new LastPx(price.getValue()));
exReport.Set(new LastShares(orderQty.Value));
exReport.Set(new LastPx(price.Value));

if (n.IsSetAccount())
exReport.SetField(n.Account);
Expand Down Expand Up @@ -211,7 +208,7 @@ public void OnMessage(QuickFix.FIX43.NewOrderSingle n, SessionID s)
Price price = new Price(DEFAULT_MARKET_PRICE);
ClOrdID clOrdID = n.ClOrdID;

switch (ordType.getValue())
switch (ordType.Value)
{
case OrdType.LIMIT:
price = n.Price;
Expand All @@ -230,14 +227,14 @@ public void OnMessage(QuickFix.FIX43.NewOrderSingle n, SessionID s)
symbol, // Shouldn't be here?
side,
new LeavesQty(0),
new CumQty(orderQty.getValue()),
new AvgPx(price.getValue()));
new CumQty(orderQty.Value),
new AvgPx(price.Value));

exReport.Set(clOrdID);
exReport.Set(symbol);
exReport.Set(orderQty);
exReport.Set(new LastQty(orderQty.getValue()));
exReport.Set(new LastPx(price.getValue()));
exReport.Set(new LastQty(orderQty.Value));
exReport.Set(new LastPx(price.Value));

if (n.IsSetAccount())
exReport.SetField(n.Account);
Expand Down Expand Up @@ -266,7 +263,7 @@ public void OnMessage(QuickFix.FIX44.NewOrderSingle n, SessionID s)
Price price = new Price(DEFAULT_MARKET_PRICE);
ClOrdID clOrdID = n.ClOrdID;

switch (ordType.getValue())
switch (ordType.Value)
{
case OrdType.LIMIT:
price = n.Price;
Expand All @@ -285,14 +282,14 @@ public void OnMessage(QuickFix.FIX44.NewOrderSingle n, SessionID s)
symbol, //shouldn't be here?
side,
new LeavesQty(0),
new CumQty(orderQty.getValue()),
new AvgPx(price.getValue()));
new CumQty(orderQty.Value),
new AvgPx(price.Value));

exReport.Set(clOrdID);
exReport.Set(symbol);
exReport.Set(orderQty);
exReport.Set(new LastQty(orderQty.getValue()));
exReport.Set(new LastPx(price.getValue()));
exReport.Set(new LastQty(orderQty.Value));
exReport.Set(new LastPx(price.Value));

if (n.IsSetAccount())
exReport.SetField(n.Account);
Expand Down Expand Up @@ -321,7 +318,7 @@ public void OnMessage(QuickFix.FIX50.NewOrderSingle n, SessionID s)
Price price = new Price(DEFAULT_MARKET_PRICE);
ClOrdID clOrdID = n.ClOrdID;

switch (ordType.getValue())
switch (ordType.Value)
{
case OrdType.LIMIT:
price = n.Price;
Expand All @@ -339,14 +336,14 @@ public void OnMessage(QuickFix.FIX50.NewOrderSingle n, SessionID s)
new OrdStatus(OrdStatus.FILLED),
side,
new LeavesQty(0),
new CumQty(orderQty.getValue()));
new CumQty(orderQty.Value));

exReport.Set(clOrdID);
exReport.Set(symbol);
exReport.Set(orderQty);
exReport.Set(new LastQty(orderQty.getValue()));
exReport.Set(new LastPx(price.getValue()));
exReport.Set(new AvgPx(price.getValue()));
exReport.Set(new LastQty(orderQty.Value));
exReport.Set(new LastPx(price.Value));
exReport.Set(new AvgPx(price.Value));

if (n.IsSetAccount())
exReport.SetField(n.Account);
Expand Down Expand Up @@ -601,4 +598,4 @@ public void OnMessage(QuickFix.FIX50.BusinessMessageReject n, SessionID s) { }

#endregion //MessageCracker overloads
}
}
}
4 changes: 0 additions & 4 deletions Examples/Executor/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.ConstrainedExecution;
using System.Text;
using QuickFix;
using QuickFix.Logger;
using QuickFix.Store;
Expand Down
1 change: 1 addition & 0 deletions Examples/SimpleAcceptor/Examples.SimpleAcceptor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<RootNamespace>SimpleAcceptor</RootNamespace>
<AssemblyName>SimpleAcceptor</AssemblyName>
<Copyright>Copyright © Connamara Systems, LLC 2011</Copyright>
Expand Down
4 changes: 0 additions & 4 deletions Examples/SimpleAcceptor/Program.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QuickFix;
using QuickFix.Logger;
using QuickFix.Store;
using QuickFix.Transport;

namespace SimpleAcceptor
{
Expand Down
10 changes: 1 addition & 9 deletions Examples/SimpleAcceptor/SimpleAcceptorApp.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using QuickFix;
using QuickFix.Fields;

namespace SimpleAcceptor
{
Expand All @@ -16,8 +11,6 @@ namespace SimpleAcceptor

public class SimpleAcceptorApp : /*QuickFix.MessageCracker,*/ QuickFix.IApplication
{
#region QuickFix.Application Methods

public void FromApp(Message message, SessionID sessionID)
{
Console.WriteLine("IN: " + message);
Expand All @@ -42,6 +35,5 @@ public void ToAdmin(Message message, SessionID sessionID)
public void OnCreate(SessionID sessionID) { }
public void OnLogout(SessionID sessionID) { }
public void OnLogon(SessionID sessionID) { }
#endregion
}
}
}
1 change: 1 addition & 0 deletions Examples/TradeClient/Examples.TradeClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<RootNamespace>TradeClient</RootNamespace>
<AssemblyName>TradeClient</AssemblyName>
<Copyright>Copyright © Connamara Systems, LLC 2011</Copyright>
Expand Down
5 changes: 1 addition & 4 deletions Examples/TradeClient/Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QuickFix.Logger;
using QuickFix.Store;

Expand Down Expand Up @@ -45,7 +42,7 @@ static void Main(string[] args)
application.Run();
initiator.Stop();
}
catch (System.Exception e)
catch (Exception e)
{
Console.WriteLine(e.Message);
Console.WriteLine(e.StackTrace);
Expand Down
Loading
Loading