From 602137050c704ae6cab307f5cdb65c1d8e572ff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=97=D0=B0=D0=B9=D1=86=D0=B5=D0=B2=20=D0=90=D0=BB=D0=B5?= =?UTF-8?q?=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80?= Date: Mon, 27 Dec 2021 07:28:37 +0300 Subject: [PATCH] fix --- QRCoderGUITreeData.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/QRCoderGUITreeData.cs b/QRCoderGUITreeData.cs index 68d4b68..07ab2fe 100644 --- a/QRCoderGUITreeData.cs +++ b/QRCoderGUITreeData.cs @@ -467,14 +467,16 @@ public object GetInvokeCtor(ConstructorInfo ctor, Dictionary cnt if (ctor.GetParameters().Length == 0) //constrictor without parameters = there is no constructor { ctorObj = ctor.Invoke(new object[] { }); - //сопоставить параметры по имени - foreach (KeyValuePair entry in cntrlFromForm) + + try + { + //сопоставить параметры по имени + foreach (KeyValuePair entry in cntrlFromForm) { ctorObj.GetType().GetProperty(entry.Key).SetValue(ctorObj, entry.Value); } - try - { + object instance = ctor.Invoke(ctorObj, new object[] { }); } catch (Exception e)