/// <summary> /// Helper funtion /// </summary> private static SingleTradelist GetSafeSingle(TradelistContainer _container, uint TradeId) { BaseTradelist blist = null; _container.dict.TryGetValue(TradeId, out blist); SingleTradelist slist = blist as SingleTradelist; if (slist != null) { return(slist); } else { slist = new SingleTradelist(); _container.dict[TradeId] = slist; return(slist); } }
/// <summary> /// Helper funtion /// </summary> private static GroupedTradelist GetSafeGroup(TradelistContainer _container, uint TradeId) { BaseTradelist blist = null; _container.dict.TryGetValue(TradeId, out blist); GroupedTradelist glist = blist as GroupedTradelist; if (glist != null) { return(glist); } else { glist = new GroupedTradelist(); _container.dict[TradeId] = glist; return(glist); } }