Пример #1
0
        public static IServerPermission GetServerPermission(ServerType type)
        {
            IServerPermission serverPermission = null;

            if (type == ServerType.MoexDataServer)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new MoexIssPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }
            if (type == ServerType.MfdWeb)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new MfdServerPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }
            if (type == ServerType.Tinkoff)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new TinkoffServerPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }

            return(null);
        }
Пример #2
0
        public static IServerPermission GetServerPermission(ServerType type)
        {
            IServerPermission serverPermission = null;

            if (type == ServerType.MoexDataServer)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new MoexIssPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }
            if (type == ServerType.MfdWeb)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new MfdServerPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }
            if (type == ServerType.Tinkoff)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new TinkoffServerPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }
            if (type == ServerType.HuobiSpot)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new HuobiSpotServerPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }
            if (type == ServerType.HuobiFutures)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new HuobiFuturesServerPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }
            if (type == ServerType.HuobiFuturesSwap)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new HuobiFuturesSwapServerPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }
            if (type == ServerType.GateIoFutures)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new GateIoFuturesServerPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }


            return(null);
        }
Пример #3
0
        public static IServerPermission GetServerPermission(ServerType type)
        {
            IServerPermission serverPermission = null;

            if (type == ServerType.Binance)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new BinanceSpotServerPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }
            if (type == ServerType.BinanceFutures)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new BinanceFuturesServerPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }
            if (type == ServerType.Bitfinex)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new BitFinexServerPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }
            if (type == ServerType.Kraken)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new KrakenServerPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }

            if (type == ServerType.MoexDataServer)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new MoexIssPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }
            if (type == ServerType.MfdWeb)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new MfdServerPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }
            if (type == ServerType.Finam)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new FinamServerPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }
            if (type == ServerType.Tinkoff)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new TinkoffServerPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }
            if (type == ServerType.HuobiSpot)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new HuobiSpotServerPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }
            if (type == ServerType.HuobiFutures)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new HuobiFuturesServerPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }
            if (type == ServerType.HuobiFuturesSwap)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new HuobiFuturesSwapServerPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }
            if (type == ServerType.GateIoFutures)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new GateIoFuturesServerPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }
            if (type == ServerType.Bybit)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new BybitServerPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }
            if (type == ServerType.InteractivBrokers)
            {
                serverPermission = _serversPermissions.Find(s => s.ServerType == type);

                if (serverPermission == null)
                {
                    serverPermission = new InteractiveBrokersServerPermission();
                    _serversPermissions.Add(serverPermission);
                }

                return(serverPermission);
            }



            return(null);
        }