コード例 #1
0
ファイル: FileFormat.cs プロジェクト: hol353/ApsimX
        /// <summary>Create a simulations object by reading the specified filename</summary>
        /// <param name="s">The stream to read from.</param>
        public ModelWrapper Read(Stream s)
        {
            XmlReader reader = new APSIMFileReader(s);
            reader.Read();

            Assembly modelsAssembly = null;
            foreach (Assembly a in AppDomain.CurrentDomain.GetAssemblies())
                if (!a.IsDynamic && Path.GetFileName(a.Location) == "Models.exe")
                    modelsAssembly = a;

            return XmlUtilities.Deserialise(reader, modelsAssembly) as ModelWrapper;
        }
コード例 #2
0
ファイル: FileFormat.cs プロジェクト: hol353/ApsimX
        /// <summary>Create a simulations object by reading the specified filename</summary>
        /// <param name="node">XML node to read from.</param>
        public ModelWrapper Read(XmlNode node)
        {
            APSIMFileConverter.ConvertToLatestVersion(node);

            XmlReader reader = new APSIMFileReader(node);
            reader.Read();

            Assembly modelsAssembly = null;
            foreach (Assembly a in AppDomain.CurrentDomain.GetAssemblies())
                if (!a.IsDynamic && Path.GetFileName(a.Location) == "Models.exe")
                    modelsAssembly = a;

            return XmlUtilities.Deserialise(reader, modelsAssembly) as ModelWrapper;
        }
コード例 #3
0
ファイル: FileFormat.cs プロジェクト: oseledets/ApsimX
        /// <summary>Create a simulations object by reading the specified filename</summary>
        /// <param name="s">The stream to read from.</param>
        public ModelWrapper Read(Stream s)
        {
            XmlReader reader = new APSIMFileReader(s);

            reader.Read();

            Assembly modelsAssembly = null;

            foreach (Assembly a in AppDomain.CurrentDomain.GetAssemblies())
            {
                if (!a.IsDynamic && Path.GetFileName(a.Location) == "Models.exe")
                {
                    modelsAssembly = a;
                }
            }

            return(XmlUtilities.Deserialise(reader, modelsAssembly) as ModelWrapper);
        }
コード例 #4
0
ファイル: FileFormat.cs プロジェクト: oseledets/ApsimX
        /// <summary>Create a simulations object by reading the specified filename</summary>
        /// <param name="node">XML node to read from.</param>
        public ModelWrapper Read(XmlNode node)
        {
            APSIMFileConverter.ConvertToLatestVersion(node);

            XmlReader reader = new APSIMFileReader(node);

            reader.Read();

            Assembly modelsAssembly = null;

            foreach (Assembly a in AppDomain.CurrentDomain.GetAssemblies())
            {
                if (!a.IsDynamic && Path.GetFileName(a.Location) == "Models.exe")
                {
                    modelsAssembly = a;
                }
            }

            return(XmlUtilities.Deserialise(reader, modelsAssembly) as ModelWrapper);
        }