KeyValueSerializationInfo SerializeSerializaeInfo(string key, object value, IEnumerable <Type> knownTypes)
        {
            if (key == null)
            {
                throw new ArgumentNullException("key");
            }
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }
            var serializationInfo = new KeyValueSerializationInfo {
                Key  = key,
                Type = value.GetType().FullName
            };

            using (var writer = new StringWriter())
                using (var xmlWriter = new XmlTextWriter(writer)){
                    try {
                        DataContractSerializer serializer = new DataContractSerializer(value.GetType(), knownTypes);
                        serializer.WriteObject(xmlWriter, value);
                    }
                    catch (Exception ex) {
                        throw new Exception("設定値のシリアライズに失敗しました。", ex);
                    }

                    try {
                        serializationInfo.Value = writer.ToString();
                    }
                    catch (Exception ex) {
                        throw new Exception("シリアライズ済み文字列の取得に失敗しました。", ex);
                    }
                }
            return(serializationInfo);
        }
        object DeserializSeserializeInfo(KeyValueSerializationInfo info, IEnumerable <Type> knownTypes)
        {
            if (info == null)
            {
                throw new ArgumentNullException("info");
            }

            // 設定の型を取得
            Type type = Type.GetType(info.Type, false);

            if (type == null)
            {
                foreach (var knownType in knownTypes)
                {
                    if (knownType.FullName == info.Type)
                    {
                        type = knownType;
                        break;
                    }
                }
            }

            if (type == null)
            {
                if (logger_ != null)
                {
                    logger_.Error("設定取得に失敗しました。(キー:{0}, 型:{1})",
                                  new object[] { info.Key, info.Type });
                }
                return(null);
            }

            // デシリアライズ
            try {
                using (var reader = new StringReader(info.Value))
                    using (var xmlReader = new XmlTextReader(reader)) {
                        DataContractSerializer serializer = new DataContractSerializer(type, knownTypes);
                        return(serializer.ReadObject(xmlReader));
                    }
            }
            catch (Exception ex) {
                throw new Exception("設定値のデシリアライズに失敗しました。", ex);
            }
        }