Beispiel #1
0
        public SwiPrologModule CreateModule(string name, dynamic settings)
        {
            if (modules.Find(m => m.Name == name) != null)
            {
                throw new ArgumentException("A module with that name already exists.", nameof(name));
            }

            var newModule = new SwiPrologModule(this, name, settings);

            modules.Add(newModule);
            return(newModule);
        }
Beispiel #2
0
        public SwiPrologModule CreateModule()
        {
            string name;
            var    random = new Random((int)DateTime.Now.Ticks);

            do
            {
                name = "m_" + random.Next().ToString();
            }while (modules.Find(m => m.Name == name) != null);

            var newModule = new SwiPrologModule(this, name);

            modules.Add(newModule);
            return(newModule);
        }