コード例 #1
0
        public ProcessorConfiguration Load()
        {
            if (!_configFile.Exists())
            {
                throw new ConfigurationLoadException("No configuration file found!");
            }

            var stream = _configFile.GetStream();

            using (stream)
            {
                if (stream.Length == 0)
                {
                    throw new ConfigurationLoadException("The configuration file is empty");
                }

                return(Serializer.ReadObject(stream) as ProcessorConfiguration);
            }
        }