fix array binding

pull/1/head
Ogoun 5 years ago
parent e56cdfd501
commit 689ffad9d4

@ -3,7 +3,6 @@ using System.Net;
using System.Threading; using System.Threading;
using ZeroLevel; using ZeroLevel;
using ZeroLevel.Network; using ZeroLevel.Network;
using ZeroLevel.Network.SDL;
using ZeroLevel.Services.Applications; using ZeroLevel.Services.Applications;
namespace TestApp namespace TestApp

@ -477,7 +477,8 @@ namespace ZeroLevel.Services.Config
{ {
case 0: return; case 0: return;
case 1: // field case 1: // field
if (TypeHelpers.IsArray(member.ClrType)) if (TypeHelpers.IsArray(member.ClrType)
&& member.ClrType.GetArrayRank() == 1)
{ {
var itemType = member.ClrType.GetElementType(); var itemType = member.ClrType.GetElementType();
var elements = SplitRange(First(member.Name), itemType).ToArray(); var elements = SplitRange(First(member.Name), itemType).ToArray();
@ -506,8 +507,10 @@ namespace ZeroLevel.Services.Config
} }
break; break;
default: // array, or first default: // array, or first
if (TypeHelpers.IsArray(member.ClrType)) if (TypeHelpers.IsArray(member.ClrType)
&& member.ClrType.GetArrayRank() == 1)
{ {
//throw new NotSupportedException("Multidimensions array not supported");
var itemType = member.ClrType.GetElementType(); var itemType = member.ClrType.GetElementType();
if (itemType == typeof(string)) if (itemType == typeof(string))
{ {

Loading…
Cancel
Save

Powered by TurnKey Linux.