Пример #1
0
        public void FromXML(StreamReader sr)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(AIDescription));
            AIDescription tmp        = serializer.Deserialize(sr) as AIDescription;

            this.ModuleName           = tmp.ModuleName;
            this.MainClassName        = tmp.MainClassName;
            this.MainClassStartMethod = tmp.MainClassStartMethod;
            this.ConstructorArgument  = tmp.ConstructorArgument;
            sr.Close();
        }
Пример #2
0
        public void Load()
        {
            this.loaded = false;
            using (StreamReader sr = new StreamReader(this.descriptionFile))
            {
                this.aiDescription = new AIDescription();
                this.aiDescription.FromXML(sr);
            }
            Assembly DLL = Assembly.LoadFile(this.dllFile);

            loadedType   = DLL.GetType(this.aiDescription.MainClassName);
            loadedObject = Activator.CreateInstance(loadedType, this.aiDescription.ConstructorArgument);
            this.loaded  = true;
        }