示例#1
0
        public static void Register(ISourceManager sourceManager, IServiceLocator serviceLocator)
        {
            #region YahooServiceRegistery
            var YahooSourceName = typeof(ExchangeInterfaceYahoo).FullName;
            var sourceYahoo     = sourceManager.GetSourceByName(YahooSourceName);
            if (sourceYahoo == null)
            {
                sourceManager.AddSource(new XeGatewaySource()
                {
                    Active          = true,
                    AdditionalParms = "",
                    Endpoint        = "",
                    Name            = YahooSourceName
                });
            }
            serviceLocator.AddService((IXeService)Activator.CreateInstance(typeof(ExchangeInterfaceYahoo)));
            #endregion

            #region OandaServiceRegistery
            var OandaSourceName = typeof(ExchangeInterfaceOanda).FullName;
            var sourceOanda     = sourceManager.GetSourceByName(OandaSourceName);
            if (sourceOanda == null)
            {
                sourceManager.AddSource(new XeGatewaySource()
                {
                    Active          = true,
                    AdditionalParms = "",
                    Endpoint        = "",
                    Name            = OandaSourceName
                });
            }
            serviceLocator.AddService((IXeService)Activator.CreateInstance(typeof(ExchangeInterfaceOanda)));
            #endregion
        }