Esempio n. 1
0
        //Добавить соединение в поток
        public ProviderConnect AddConnect(string code)
        {
            var con = Connects[code];

            if (!Connects.ContainsKey(code))
            {
                var scon = Project.SchemeConnects[code];
                con = ProvidersFactory.CreateConnect(Logger, scon.Type, scon.Code, scon.Complect, Project.Code);
                con = Connects.Add(code, con);
                if (con.Type == ProviderType.Source)
                {
                    _sources.Add(con.Code, (SourceConnect)con);
                }
                if (con.Type == ProviderType.Receiver)
                {
                    _receivers.Add(con.Code, (ReceiverConnect)con);
                }
                if (!scon.ProviderCode.IsEmpty() && !scon.ProviderInf.IsEmpty())
                {
                    con.JoinProvider(ProvidersFactory.CreateProvider(Logger, scon.ProviderCode, scon.ProviderInf, Project.Code));
                }
            }
            return(con);
        }
Esempio n. 2
0
 /// <summary>
 ///     Add a connect to the module
 /// </summary>
 /// <param name="connect"></param>
 public void Add(Connect connect)
 {
     Connects.Add(connect);
 }