Ejemplo n.º 1
0
 private object GetControlPropertyValue(string controlName, string propertyName)
 {
     if (m_form.InvokeRequired)
     {
         Delegate d       = new GetControlPropertyValueHandler(GetControlPropertyValue);
         object[] o       = new object[] { controlName, propertyName };
         object   iResult = m_form.Invoke(d, o);
         resetEvent.WaitOne();
         return(iResult);
     }
     else
     {
         Type         t1      = m_form.GetType();
         FieldInfo    fi      = t1.GetField(controlName, flags);
         object       ctrl    = fi.GetValue(m_form);
         Type         t2      = ctrl.GetType();
         PropertyInfo pi      = t2.GetProperty(propertyName);
         object       gResult = pi.GetValue(ctrl, null);
         resetEvent.Set();
         return(gResult);
     }
 }
Ejemplo n.º 2
0
 private object GetControlPropertyValue(string controlName,string propertyName)
 {
     if (m_form.InvokeRequired)
     {
         Delegate d = new GetControlPropertyValueHandler(GetControlPropertyValue);
         object[] o = new object[] { controlName, propertyName };
         object iResult = m_form.Invoke(d, o);
         resetEvent.WaitOne();
         return iResult;
     }
     else
     {
         Type t1 = m_form.GetType();
         FieldInfo fi = t1.GetField(controlName, flags);
         object ctrl = fi.GetValue(m_form);
         Type t2 = ctrl.GetType();
         PropertyInfo pi = t2.GetProperty(propertyName);
         object gResult = pi.GetValue(ctrl, null);
         resetEvent.Set();
         return gResult;
     }
 }